/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/**/
void parse_matches(double *fea,int *indA,int *indB,int *mask,int start,int stop,int *N);
void slam_parse_matches(double *fea,int *indA,int *indB,int camera,int *mask,int start,int stop,int *N);
void slam_stereo_parse_matches(double *fea,int *indA,int *indB,int *mask,int start,int stop,int *N);
/**/
void update_fea(double *fea,double *featuresB,int frame,int *start,int num_featuresA,int num_featuresB,int *matches,float *strength);
void stereo_update_fea(double *fea,double *featuresB,int frame,int camera,int *start,int num_featuresA,int num_featuresB,int *matches);
/**/
void inc_XX(double *XX,double *fea,double *X,int *indB,int *inumm,int num_featuresB);
void slam_inc_XX(double *XX,double *fea,double *X,int *indB,int *inumm,int num_featuresB);
void slam_stereo_inc_XX(double *XX,double *fea,double *X,int *indB,int *inumm,int num_featuresB);
/**/
void update_XX(  double *XX,double *X,int *indX,int N);
/**/
void parse_args_for_slam(double *fea,double *XX,double *z,int *ind,int *indf,double *X,int *indx,int *indX,int *indz,int *jj,int *kk,int N, int window);
void parse_fea_for_slam(double *fea,double *XX,double *z,int *ind,int *indf,double *X,int *indx,int *indX,int *indz,int *jj,int *kk,int N, int window);
void stereo_parse_args_for_slam(double *fea,double *XX,double *z,int *ind,int *indf,int *indc,double *X,int *indx,int *indX,int *indz,int *jj,int *kk,int N,int window);
/**/
void prune_fea(double *fea,int *ind2,int *mask,int N);
void slam_prune_fea(double *fea,int *ind2,int *mask,int N);
void slam_stereo_prune_fea(double *fea,int *ind2,int *mask,int N);
/**/
void init_fea(  double *fea,double *features,int *frame,int *start,int N);
void stereo_init_fea(  double *fea,double *features,int frame,int camera,int level,int *start,int N);
void stereo_add_fea(double *fea,double *featuresB,int frame,int camera,int level,int *start,int num_featuresB);
void slam_fea_update_stereo_matches(double *fea,int startA,int startB,int num_featuresA,int *matches,float *strength);
void slam_fea_update_matches(double *fea,int startA,int startB,int num_featuresA,int *matches,float *strength);
void slam_stereo_prune_slamfea(double *fea,int *indz,double *er,double th,int N);
void prune_slamfea(double *fea,int *indz,double *er,double th,int N);
void parse_normal_fea_stereo(int *ind,int *indf,int *indc,double *e,double th,int *nind,int *jj,int w,int N);

